package cn.jiahua.hospital.service;

import cn.jiahua.hospital.exceptions.RedisException;
import cn.jiahua.hospital.exceptions.TokenProtectedException;
import cn.jiahua.hospital.pojo.Doctor;
import cn.jiahua.hospital.pojo.Hospital;
import cn.jiahua.hospital.pojo.User;
import cn.jiahua.hospital.vo.TokenVo;

/**
 * @ClassName TokenService
 * @Description TODO
 * @Author yaozhaobao
 * @Date 2021/4/6 11:29
 * @Version 1.0
 **/

public interface TokenService {

    public TokenVo genenrateToken(User user);

    public TokenVo refreshToken(String oldtoken) throws RedisException, TokenProtectedException;

    public void saveToken(String token, User user);

    public TokenVo genenrateToken(Hospital hospital);

    public void saveToken(String token, Hospital hospital);

    public TokenVo genenrateToken(Doctor doctor);

    public void saveToken(String token, Doctor doctor);
}
